<template>
  <yd-ls-layout title="邀请加入" :onfoot=false >
    <div class="yd-ls-height"></div>
    <div class="yd-ls-scan-base">
      <div class="info-img" >
        <img :src="scan.head"/>
      </div>
      <p>{{ scan.docter_name }}</p>
      <span>{{ scan.hospital_name }} | {{ scan.title }}</span>
    </div>
    <div class="m-invite-box">
      <div class="img-box">
        <img :src="scan.qr_code"/>
      </div>
      <div class="txt-box">
        <span>
          <ul>
            <li>长按识别二维码，关注公众号并完成注册，即可购买药品</li>
          </ul>
        </span>
      </div>
    </div>
  </yd-ls-layout>
</template>

<style>
  .yd-ls-scan-base{
    width:100%;
    background-color: rgb(72, 112, 243);;
    padding: 0.52rem 0 0.34rem;
    overflow:hidden;
    text-align: center;

  }
  .yd-ls-scan-base .info-img{
    width: 1.16rem;
    height: 1.16rem;
    border-radius: 50%;
    display: inline-block;
    overflow: hidden;
  }
  .yd-ls-scan-base .info-img img{
    width: 100%;
    height: 100%;
  }
  .yd-ls-scan-base p{
    font-size: 0.32rem;
    color: #fff;
  }
  .yd-ls-scan-base span{
    font-size: 0.26rem;
    color: rgba(255,255,255,0.3);
  }
  .m-invite-box{
    width: 80%;
    overflow: hidden;
    margin: 0.3rem auto 0;
    border:1px solid #c6c6c6;
    border-radius: 3px;
  }
  .m-invite-box .img-box{
    padding: 0.56rem;
  }
  .m-invite-box .txt-box{
    padding: 0.15rem;
    background-color: #eee;
    border-top: 1px solid #c6c6c6;
    overflow: hidden;
    line-height: 0.44rem;
  }
  .m-invite-box .txt-box em{
    width: 0.7rem;
    height: 0.7rem;
    line-height: 0.7rem;
    border-radius: 100%;
    display: inline-block;
    text-align: center;
    background-color: #fff;
    overflow: hidden;
    margin-right: 0.2rem;
    float: left;
  }
  .m-invite-box .txt-box span{
    font-size: 0.28rem
  }
  .m-invite-box .txt-box p{
    font-size: 0.24rem;
    margin-top: 0.06rem;
    color: #909090;
  }
  .m-invite-box .img-box img,
  .m-invite-box .txt-box em img{
    width: 100%;
  }
  .m-invite-btn-box{
    padding: 0 10%;
  }
</style>
<script>
  import ydLsLayout from '../../components/yd-ls-layout.vue'
  import api from '../../axios/api'

  export default {
    name: 'yyscan',
    data() {
      return {
        type: 0,
        scan: {}
      }
    },
    created() {
      //TODO:初始化数据
      let recipeid = this.$route.query.recipeid || 1
      this.getScan(recipeid)
    },
    methods: {
      getScan(id) {
        this.axios.get(api.app_recipe, {params:{recipe_id: id}})
          .then(m=>{
            let scan_data = m.data
            this.scan = scan_data.data
          })
      }
    },
    mounted() {
    },
    components: { ydLsLayout }


  }
</script>
